from flask import Flask, render_template, jsonify
from spider.analyse import *

app = Flask(__name__)


@app.route('/')
def index():  # put application's code here
    return render_template('index.html')


@app.route('/line')
def line():
    return jsonify(line_plot())


@app.route('/pie')
def pie():
    return jsonify(pie_plot())


@app.route('/bar')
def bar():
    return jsonify(bar_plot())


@app.route('/word')
def word():
    return jsonify(word_cloud_plot())


@app.route('/boxplot')
def boxplot():
    return jsonify(boxplot_data())


@app.route('/mean')
def mean():
    return jsonify(mean_price_bar())


if __name__ == '__main__':
    app.run()
